<template>
  <div>
    <h1>WangEditor Demo</h1>
    <wang-editor :content="content" @editorContent="getEditorContent"/>
    <h2>效果区域展示：</h2>
    <div ref="preview" v-html="content"></div>
  </div>
</template>
<script>
import WangEditor from '@/components/wang-editor'
export default {
  components: {
    WangEditor
  },
  data() {
    return {
      // 编辑器内容
      content: ''
    }
  },
  methods: {
    // 获取编辑器内容
    getEditorContent(data) {
      this.content = data
    }
  }
}
</script>
